0 CpxTRS
↳1 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxWeightedTrs
↳3 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxTypedWeightedTrs
↳5 CompletionProof (UPPER BOUND(ID), 0 ms)
↳6 CpxTypedWeightedCompleteTrs
↳7 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳8 CpxRNTS
↳9 CompleteCoflocoProof (⇔, 80 ms)
↳10 BOUNDS(1, 1)
f(x, x) → f(g(x), x)
g(x) → s(x)
f(x, x) → f(g(x), x) [1]
g(x) → s(x) [1]
f(x, x) → f(g(x), x) [1]
g(x) → s(x) [1]
f :: s → s → f g :: s → s s :: s → s |
f(v0, v1) → null_f [0]
null_f, const
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
null_f => 0
const => 0
f(z, z') -{ 1 }→ f(g(x), x) :|: z' = x, x >= 0, z = x
f(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
g(z) -{ 1 }→ 1 + x :|: x >= 0, z = x
eq(start(V, V1),0,[f(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1),0,[g(V, Out)],[V >= 0]). eq(f(V, V1, Out),1,[g(V2, Ret0),f(Ret0, V2, Ret)],[Out = Ret,V1 = V2,V2 >= 0,V = V2]). eq(g(V, Out),1,[],[Out = 1 + V3,V3 >= 0,V = V3]). eq(f(V, V1, Out),0,[],[Out = 0,V4 >= 0,V5 >= 0,V = V4,V1 = V5]). input_output_vars(f(V,V1,Out),[V,V1],[Out]). input_output_vars(g(V,Out),[V],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [g/2]
1. recursive : [f/3]
2. non_recursive : [start/2]
#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is partially evaluated into f/3
2. SCC is partially evaluated into start/2
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations f/3
* CE 5 is refined into CE [6]
* CE 4 is refined into CE [7]
### Cost equations --> "Loop" of f/3
* CEs [7] --> Loop 4
* CEs [6] --> Loop 5
### Ranking functions of CR f(V,V1,Out)
#### Partial ranking functions of CR f(V,V1,Out)
### Specialization of cost equations start/2
* CE 2 is refined into CE [8]
* CE 3 is refined into CE [9]
### Cost equations --> "Loop" of start/2
* CEs [8,9] --> Loop 6
### Ranking functions of CR start(V,V1)
#### Partial ranking functions of CR start(V,V1)
Computing Bounds
=====================================
#### Cost of chains of f(V,V1,Out):
* Chain [5]: 0
with precondition: [Out=0,V>=0,V1>=0]
* Chain [4,5]: 2
with precondition: [Out=0,V=V1,V>=0]
#### Cost of chains of start(V,V1):
* Chain [6]: 2
with precondition: [V>=0]
Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [6] with precondition: [V>=0]
- Upper bound: 2
- Complexity: constant
### Maximum cost of start(V,V1): 2
Asymptotic class: constant
* Total analysis performed in 34 ms.